package com.lmm.rpc.core.serialization;
/**
 * 序列化工厂
 * */
public class SerializationFactory {
    public static Serialization getRpcSerialization(SerializationTypeEnum typeEnum) {
        switch (typeEnum) {
            case HESSIAN:
                return new HessianSerialization();
            case JSON:
                return new JsonSerialization();
            default:
                throw new IllegalArgumentException("serialization type is illegal");
        }
    }
}
